package com.tjufe;

import jdk.jfr.DataAmount;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class JD implements Switch {
    private String name;
    //定义状态：开和关
    private boolean status;//false 关   true 开
    @Override
    public void press() {
        //按钮按下
        status = !status;
        //等价于
        //   if (status){
        //      status = false;
        //   }else {
        //      status = true;
        //  }
    }

}
